<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>CatchSound</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">CatchSound()</font></b></p>
<p><b>Syntax</b></p><blockquote>

Result = <font color="#006666"><b>CatchSound</b></font>(#Sound, *Buffer [, Length [, Flags]])</blockquote>

<b>Description</b><br><blockquote>





Load a WAV (in PCM format, ADPCM is not supported) or any other format supported by the <a href="../soundplugin/index.html">SoundPlugin library</a> 
found at the specified address. The following functions can be used to enable automatically more sound formats: <br>
<br>
<a href="../soundplugin/useflacsounddecoder.html">UseFLACSoundDecoder()</a> <br>
<a href="../soundplugin/useoggsounddecoder.html">UseOGGSoundDecoder()</a> 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Sound</i></td>
<td width="90%"> 
 
A number to identify the new sound. <a href="../reference/purebasic_objects.html">#PB_Any</a> can 
be used to auto-generate this number. 

 

</td></tr>
<tr><td><i>*Buffer</i></td>
<td> 
 
The buffer to use to create the sound. This is a regular memory address. 

 

</td></tr>
<tr><td><i>Length (optional)</i></td>
<td> 
 
The buffer length. With WAV files, this parameter doesn't need to be 
specified. With other sound decoders, it has to be specified. 

 

</td></tr>
<tr><td><i>Flags (optional)</i></td>
<td> 
 
It can be the following value: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Sound_Streaming</font>: Enable streaming playback (only supported for <a href="../soundplugin/useflacsounddecoder.html">FLAC</a> and <a href="../soundplugin/useoggsounddecoder.html">OGG</a>))
</font></pre>

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>



Nonzero if the sound has been successfully created, zero otherwise. 

 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2"><font color="#006666">  CatchSound</font>(0, ?Music)
  <b><font color="#006666">End</font></b>

  <b><font color="#006666">DataSection</font></b>
    Music: 
      <b><font color="#006666">IncludeBinary</font></b> "Sound.wav"
</font></pre>

</blockquote><p><b>Remarks</b></p><blockquote>



The "?" is a pointer to a label. More information about pointers and memory access can be found 
in the relating chapter <a href="../reference/memory.html">here</a>. 

 

</blockquote><p><b>See Also</b></p><blockquote>

<a href="loadsound.html">LoadSound()</a>, <a href="freesound.html">FreeSound()</a>, <a href="playsound.html">PlaySound()</a> 

</Blockquote><p><b>Supported OS  </b><Blockquote>All</Blockquote></p><center><a href=index.html>Sound Index</a> - <a href=freesound.html>FreeSound()</a> -&gt;



</body></html>